/**
 * author:Administrator
 * date:2016/2/25
 * desc: location 是一个深林结构, 有很多个root，每个root下是一棵树
 */

'use strict';
let Repo = require('./LocationRepo.js');

let ROOT_PID = 0;

class Location {

  constructor(pojo) {
    pojo = pojo || {};
    this.id = pojo.id;
    this.pid = pojo.pid || ROOT_PID;
    this.name = pojo.name;
  }

  * store() {
    return yield Repo.store(this);
  }

}

module.exports = Location;